home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 September / Chip_2000-09_cd1.bin / sharewar / Slunec / app / 16 / MISC.SWG / 0014_QV-10 CAM (Unofficial).pas < prev    next >
Pascal/Delphi Source File  |  1997-05-11  |  8KB  |  171 lines

  1.                                                             96/05/18
  2. QV-10 CAM Format
  3. ================
  4.   This document describes the CAM file which is used for QV- 10.
  5.   This information is not official, but is the result of individual
  6.   analysis.  The "@@" mark indicates information based on assumptions.
  7.  
  8.  
  9. Structure of CAM Format
  10. =======================
  11.   CAM format can be divided into four areas.
  12.        _______________  __________________________________________
  13.        Area Name        Data
  14.        ===============  ==========================================
  15.        header area      holds information relating
  16.                           to the other three areas
  17.        ---------------  ------------------------------------------
  18.        comment area     used for comments
  19.        ---------------  ------------------------------------------
  20.        thumbnail        thumbnail image data for preview (52 x 36)
  21.          image area
  22.        ---------------  ------------------------------------------
  23.        image area       DCT coding, huffman-coding image data
  24.        ===============  ==========================================
  25.  
  26.  
  27. Structure of Header Area
  28. ------------------------
  29.   The header area holds the information concerning the size of each
  30.   area. The description of the format below appears to be usable.
  31.  
  32.        ________________________  _________________________________
  33.        Structure                 Data
  34.        ========================  =================================
  35.        identification mark       $07  $20  $4D  $4D
  36.          (4 Byte)
  37.        ------------------------  ---------------------------------
  38.        number of areas (2 byte)  3 areas so far  ($00  $03)
  39.        ------------------------  ---------------------------------
  40.        area size information     The set of data below is repeated 
  41.          (variable length)         to match each area number
  42.                                      area  ID(2 Byte)
  43.                                        $00 $01 = comment area
  44.                                        $00 $02 = thumbnail image area
  45.                                        $00 $03 = image area
  46.                                      area length(4 Byte)
  47.                                      dummy(10 Byte)
  48.        ========================  =================================
  49.  
  50.   When three areas are present the total size of the header area becomes
  51.   54 Bytes. Each area is stored after the header area, and their lengths
  52.   are equal to the area length. The order of storage is; area,  ID.
  53.  
  54.    @@: The identification mark will be changed for future machines.
  55.  
  56.  
  57. Comment Area
  58. ------------
  59.   The comment area is located in the ID=1 area of the header part. The
  60.   description of the format below appears to be usable.
  61.  
  62.        ________________________  _________________________________
  63.        Structure                 Data
  64.        ========================  =================================
  65.        comment information
  66.        (variable length)         IDs and strings
  67.        ------------------------  ---------------------------------
  68.        end mark(1 Byte)          $00
  69.        ========================  =================================
  70.  
  71.  
  72.   Comment related information utilizes the format below.
  73.  
  74.        ________________________  _________________________________
  75.        format information        Data
  76.        ========================  =================================
  77.        comment  ID(1 Byte)       from $01 to $07
  78.        ------------------------  ---------------------------------
  79.        comment(variable length)  A string ending with $00
  80.                                  $00 only, if no comment
  81.        ========================  =================================
  82.  
  83.   Comment ID uses from $01 to $07. Accordingly, its smallest size is
  84.   15 Bytes.
  85.  
  86.   In fact, $01 and $05 are used. $01 is for "comments". $05 is for "Date".
  87.    
  88.   @@: $02-$04 and $06-$07 do not appear to be in use. These ID's may
  89.       be used when the comments become long or when the comments consist
  90.       of several lines. 
  91.  
  92.  
  93. Compressed Image Area
  94. ---------------------
  95.   Compressed image area is located in the ID=2 area of the header part.
  96.   The description of the format below appears to be usable.
  97.  
  98.        _________________________  _________________________________
  99.        Format information         Data
  100.        =========================  =================================
  101.        thumbnail image            colour information(3Byte)
  102.          information (5616 Byte)                   x 52(X) x 36(Y)
  103.                                   colour information is stored in
  104.                                   the order of R,G,B and each
  105.                                   colour consumes 1Byte
  106.        =========================  =================================
  107.  
  108.   Size information of the thumbnail image is not seen in the CAM file.
  109.   Naturally, we can conclude the size is fixed at 52x36.
  110.   52 pixels are in X direction while 36 lines are in Y direction.
  111.  
  112.  
  113. Image Area
  114. ----------
  115.   The image area is located in the ID=3 area of the header part. This
  116.   area can be divided into five sections.
  117.  
  118.        __________________________  _______________________________
  119.        Format information          Data
  120.        ==========================  ===============================
  121.        Amount of element data      YUV,  3 element  ($00  $03)
  122.          (2 byte)
  123.        --------------------------  -------------------------------
  124.        element data size           2 Bytes of element data
  125.          (variable length)           are stored in a row.
  126.        --------------------------  -------------------------------
  127.        quantization table 0        Y quantization table for element
  128.          (64 Byte)
  129.        --------------------------  -------------------------------
  130.        quantization table 1        U,V  quantization table for
  131.          (64 Byte)                   element
  132.        --------------------------  -------------------------------
  133.        Y  element data             Y  element's compression data
  134.                                      image size is 480x240
  135.        --------------------------  -------------------------------
  136.        U  element data             U  element's compression data
  137.                                      image size is 160x120
  138.        --------------------------  -------------------------------
  139.        V  element data             V  element's compression data
  140.                                      image size is 160x120
  141.        ==========================  ===============================
  142.  
  143.   Any Image data are deconstructed into YUV elements and are then
  144.   DCT compressed and symbolized by a haffman code. Image sizes differ
  145.   from each other as mentioned above. It seems that the images are
  146.   deformed and re-composed using a linking tool.
  147.   In order to decode this image data, a haffman table is necessary
  148.   in addition to this information.  Such additional information is not
  149.   included in the CAM file. Compression and dedoding softwareüiQV-10 and
  150.   the link toolüj maintains this sort of fixed information inside.
  151.  
  152. Special Thanks
  153. ==============
  154.   A software which can directly handle a CAM file is required. I hope
  155.   that this modest analysis and related information will help in the
  156.   development of such software.
  157.   A document which describes the conversion method in a non-interleave
  158.   JPEG format is also available.  Please refer to this, if necessary.
  159.   
  160.   Finally I would like to thank Mr.Yamamoto (Kawasaki-steel Co.) for his
  161.   cooperation concerning the analysis of CAM files.  Also I would like to
  162.   thank members of palmtop-pc MailingList for offering us a place for
  163.   information exchange.
  164.  
  165. --------------------------------------------------------------------
  166.  Kazuhiko Iwama / Texas Instruments Japan Limited
  167.                   Design Automation Division Japan Branch
  168.    E-Mail Address : Texas Instruments ... iwama@ti.com
  169.                                RIMNET ... with@st.rim.or.jp
  170. --------------------------------------------------------------------
  171.